import update from "react-addons-update";

const defaultTheme: any = {
    showLeftMenu: true,
    themeColor: "#4277fa",
    headerColor: "#FFFFFF",
    baseBgColor: "#FFFFFF",
    btnColor: "#FFFFFF",
    menuColor: "#FFFFFF",
    menuFontColor: "#000",
    fontColor: "#000",
    fontSize: 14,
    borderRadius: 5,
}
export {
    defaultTheme
}

/**
 * tabs 模板
 * {
 *     label:必传，tab标题
 *     key:必传，唯一key
 *     isSelect:true 可空，是否选中
 *     url: 必传，路由路径
 * }
 */
const ThemeReducer: object = {
    namespace: "themeReducer",
    state: {
        themeToken: {
            ...defaultTheme
        }
    },
    updateTheme: function (params: any) {
        // @ts-ignore
        return update(this.state, {themeToken: {$set: params}});
    }
};

export default ThemeReducer;